package org.footito.android.connexion;

import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.footito.android.tools.Constants;

public class NetworkTools {
	public static DefaultHttpClient getNewHttpClient(){
		DefaultHttpClient httpclient;
//		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
//			httpclient = AndroidHttpClient.newInstance("Android");
//			HttpParams params = httpclient.getParams();
//			HttpConnectionParams.setConnectionTimeout(params, Constants.HTTP_TIMEOUT);
//			HttpConnectionParams.setSoTimeout(params, Constants.HTTP_TIMEOUT);
//		} else {
			BasicHttpParams my_httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(my_httpParams, Constants.HTTP_TIMEOUT);
			HttpConnectionParams.setSoTimeout(my_httpParams, Constants.HTTP_TIMEOUT);
			httpclient = new DefaultHttpClient(my_httpParams);
//		}
		return httpclient;
	}
}
